﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using System.Xml;
using Newtonsoft.Json;

namespace StripeOne.Core.Tools
{
    public static class StripeOneJson
    {
        public static string ToJsonString(this XmlDocument obj)
        {
            return JsonConvert.SerializeXmlNode(obj);
        }

        public static T FromJsonString<T>(string json)
        {
            return new JavaScriptSerializer().Deserialize<T>(json);
        }        
    }
}
